<style scoped>
.el-breadcrumb:last-child{
    margin-bottom: 5px;
}
</style>

<template>
    <div class="row">
        <el-checkbox v-model="comp.enabled">{{ comp.__classname__ }}</el-checkbox>
        <el-button round size="small" :icon="Document" @click="gm.toConsole(comp)"></el-button>
    </div>

    <div class="row-start">
        <el-text class="span-title" truncated>AllowSwitchOff</el-text>
        <el-checkbox size="small" v-model="comp.allowSwitchOff" />
    </div>

    <div class="row-start">
        <el-text class="span-title" truncated>CheckEvents</el-text>
    </div>
    <div class="span-left-20" v-for="data in gm.toEvents(comp.checkEvents)">
        <el-breadcrumb :separator-icon="ArrowRight">
            <el-breadcrumb-item>{{ data.target }}</el-breadcrumb-item>
            <el-breadcrumb-item>{{ data.component }}</el-breadcrumb-item>
            <el-breadcrumb-item>{{ data.handler }}</el-breadcrumb-item>
            <el-breadcrumb-item>{{ data.customEventData }}</el-breadcrumb-item>
        </el-breadcrumb>
    </div>
</template>

<script lang="ts" setup>
import { Document, ArrowRight } from '@element-plus/icons-vue'
import gm from './gm';

defineProps<{
    comp: CCComponent,
    update: Number,
}>()
</script>